package com.testmall.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description:
 * @Author: littleDesire
 * @Date: 2022-06-21 14:29
 * @Version: 1.0
 */
@ApiModel(value = "com-testmall-entity-User")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "`user`")
public class User implements Serializable {
    /**
     * 用户表id
     */
    @TableId(value = "userid", type = IdType.INPUT)
    @ApiModelProperty(value = "用户表id")
    private String userid;

    /**
     * 用户名
     */
    @TableField(value = "username")
    @ApiModelProperty(value = "用户名")
    private String username;

    /**
     * 用户密码，MD5加密
     */
    @TableField(value = "password")
    @ApiModelProperty(value = "用户密码，MD5加密")
    private String password;

    @TableField(value = "phone")
    @ApiModelProperty(value = "手机号")
    private String phone;

    /**
     * 找回密码问题
     */
    @TableField(value = "question")
    @ApiModelProperty(value = "找回密码问题")
    private String question;

    /**
     * 找回密码答案
     */
    @TableField(value = "answer")
    @ApiModelProperty(value = "找回密码答案")
    private String answer;

    /**
     * 角色0-管理员,1-普通用户
     */
    @TableField(value = "role")
    @ApiModelProperty(value = "角色0-管理员,1-普通用户")
    private Integer role;

    /**
     * 创建时间
     */
    @TableField(value = "createtime")
    @ApiModelProperty(value = "创建时间")
    private Date createtime;

    /**
     * 更新时间
     */
    @TableField(value = "updatetime")
    @ApiModelProperty(value = "更新时间")
    private Date updatetime;

    @TableField(value = "salt")
    @ApiModelProperty(value = "盐值")
    private String  salt;

    @TableField(value = "token")
    @ApiModelProperty(value = "令牌")
    private String  token;

    private static final long serialVersionUID = 1L;

    public static final String COL_USERID = "userid";

    public static final String COL_USERNAME = "username";

    public static final String COL_PASSWORD = "password";

    public static final String COL_PHONE = "phone";

    public static final String COL_QUESTION = "question";

    public static final String COL_ANSWER = "answer";

    public static final String COL_ROLE = "role";

    public static final String COL_CREATETIME = "createtime";

    public static final String COL_UPDATETIME = "updatetime";

    public static final String COL_SALT = "salt";

    public static final String COL_TOKEN = null;
}
